package org.cnc.explain.lifecycle.beaninitial_8;

import org.springframework.beans.factory.InitializingBean;

import javax.annotation.PostConstruct;

/**
 * <p>
 * #TODO: desc
 * </p>
 *
 * @author zhiyong.tan
 * @since 2022-09-01
 */
public class PriorityAfterPropertiesSetAndInitMethodBean implements InitializingBean {
	private String name;

	@Override
	public void afterPropertiesSet() throws Exception {
		this.name = "from propertiesSet";
		System.out.println("InitializingBean # afterPropertiesSet invoke");
	}
	public void initMethod(){
		this.name = "from init method";
		System.out.println("init method invoke");
	}

	@PostConstruct
	public void postConstruct(){
		System.out.println("postConstruct invoke");
	}

	@Override
	public String toString() {
		return "PriorityAfterPropertiesSetAndInitMethodBean{" +
				"name='" + name + '\'' +
				'}';
	}
}

